package com.myapp.struts.menu;

import java.util.ArrayList;

public class GBDinnerText {

    private static GBDinnerText gbDinnerTextObj;
    ArrayList<FoodItems> gbDinnerTextArray = new ArrayList<FoodItems>();

    public static synchronized GBDinnerText getSingletonObject() {
        if (gbDinnerTextObj == null) {
            gbDinnerTextObj = new GBDinnerText();
        }
        return gbDinnerTextObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getGBDinnerText(String fileLoc) {
        String fileName = "";

        MenuRead menuReadObj = new MenuRead();
        gbDinnerTextArray = menuReadObj.ReadMenu(Constants.GREAT_BRITAN);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        gbDinnerTextArray = menuGenerateObj.GenerateMenu(gbDinnerTextArray, Constants.DINNER);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(gbDinnerTextArray, Constants.TEXT, fileLoc);
        return fileName;

    }
}
